//this class creates and sets values for the contact object as well as prompts user for contact information.

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Scanner;

//one object of this class represents one contact
public class Contact implements Serializable, Comparable<Contact> {
	private String firstName;
	private String lastName;
	private String address;
	private String zipcode;
	private String emailAddress;
	private String phoneNumber;
	private String notes;
	private Scanner s;

	public Contact(String firstName, String lastName, String zipcode, String address,
			String emailAddress, String phoneNumber, String notes) {
	}

	public Contact(){
		firstName = "";
		lastName = "";
		address = "";
		zipcode = "";
		emailAddress = "";
		phoneNumber = "";
		notes = "";
		s = new Scanner(System.in);
	}
	
	// This method reads Contact information from the console
	public void readContact(){
		System.out.println("Adding New Contact\n If last name is not entered the program will return to main menu");
		if (lastName.length() == 0) {
			System.out.print("Please Enter Last Name: ");
			lastName = s.nextLine();
			if (lastName.length() == 0){ // User presses enter
				return;
			} else {
				System.out.print("Please Enter First Name: ");
				firstName = s.nextLine();
				System.out.print("Please Enter Address: ");
				address = s.nextLine();
				System.out.print("zipCode: ");
				zipcode = s.nextLine();
				System.out.print("Email Address: ");
				emailAddress = s.nextLine();
				System.out.print("Phone Number: ");
				phoneNumber = s.nextLine();
				System.out.print("Additional Notes: ");
				notes = s.nextLine();
				System.out.print("Contact has been added :)\n");
				lastName = "";
			}
		}
	}

	
	
	// this method will print the Contact with the name field before to clarify what is what W.W
	private void printContact() {
            System.out.println("Last Name:" + lastName);
            System.out.println("First Name:" + firstName);
            System.out.println("Address:" + address);
            System.out.println("Email:" + emailAddress);
            System.out.println("Zipcode:" + zipcode);
            System.out.println("Phone Number:" + phoneNumber);
            System.out.println("Notes:" + notes);
    }

	// This method returns the Last name.
	public String getLastName() {
		return lastName;
	}
	
	// This method returns the First name.
	public String getFirstName() {
		return firstName;
	}
	
	// This method returns the Address.
	public String getAddress() {
		return address;
	}
	
	// This method returns the Zip code.
	public String getZipcode() {
		return zipcode;
	}
	
	// This method returns the Email Address.
	public String getemailAddress() {
		return emailAddress;
	}
	
	// This method returns the Phone Number.
	public String getPhoneNumber() {
		return phoneNumber;
	}
	
	// This method returns the Additional Notes.
	public String getNotes() {
		return notes;
	}
	// This allows contact object to be comparable
	public int compareTo(Contact myContact) {
		return lastName.compareTo(myContact.lastName);
	}
	
}